<template>
    <div class="box">
        <van-card num="2" price="2.00" desc="描述信息" title="商品标题"
            thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg">
            <template #tags>
                <van-tag plain type="primary">标签</van-tag>
                <van-tag plain type="primary">标签</van-tag>
            </template>
            <template #footer>
                <van-button size="mini">按钮</van-button>
                <van-button size="mini">按钮</van-button>
            </template>
        </van-card>


        <van-submit-bar :price="3050" button-text="提交订单" @submit="onSubmit">
            <van-checkbox v-model="checked">全选</van-checkbox>

        </van-submit-bar>
    </div>
</template>

<script setup>
import { ref } from 'vue';
import { createApi } from '@/api/api';
import { useRoute, useRouter } from 'vue-router'
const router = useRouter()
const route = useRoute()
const onSubmit = () => {
    let obj={
        goodsIds:'51443,51444',
        username:localStorage.getItem('username'),
        product_code:'我要这两个商品',
        totalPrice:'10000',
        nums:'2,3'
    }
    createApi(obj).then(res=>{
        router.push({path:'/order',query:{orderId:res.data.data.orderId}})
    })
};

</script>

<style lang="scss" scoped></style>